from django.contrib import admin

# Register your models here.
from .models import MusicList, MusicCategory
import xadmin

class MusicAdmin(object):
    list_display = ('name', 'music_src', 'like_count', 'is_original', 'is_download', 'category',
                    'upload_time', 'user',)
    search_fields = ('name', 'user', 'category',)
    readonly_fields = ('name', 'music_src', 'like_count', 'is_original', 'is_download', 'category',
                       'upload_time', 'user',)
    show_detail_fields = ('user',)
    model_icon = 'fa fa-music'


class MusicCategoryAdmin(object):
    list_display = ('name',)


xadmin.site.register(MusicList, MusicAdmin)
xadmin.site.register(MusicCategory, MusicCategoryAdmin)